#ifndef _OPTION_TYPE_NUMERIC_FILE_H_
#define _OPTION_TYPE_NUMERIC_FILE_H_

#include <string>
#include <vector>
#include <sstream>
#include <limits>

#include "OptionType.h"


namespace inilib
{

	/**
	 * Standard templated numeric type with normal settings (name, isMandatory, amount)
	 * plus it is possible to set minimal and maximal acceptable value.
	 *
	 * All the conversion operators for the standard data types are redefined so this type
	 * actually allows to work with numbers in different numeral systems (for integer types).
	 * prefix 0x (hexadecimal)
	 * prefix 0 (octal)
	 * prefix 0p (binary)
	 */
	template <typename T>
	class OptionTypeNumeric : public OptionType
	{
	public:
		explicit OptionTypeNumeric (
			const std::string & optionName,
			Mandatory isMandatory = NONMANDATORY,
			ValuesAmount amount = SINGLE_VALUE,
			const T & defaultValue = 0,
			const T & minValue = std::numeric_limits< T >::lowest(),
			const T & maxValue = std::numeric_limits< T >::max(),
			char separator = ','
		);

		virtual std::vector< std::string > GetDefaultValue () const;

	protected:
		virtual bool AreValuesValid_ ( const std::vector< std::string > & values ) const;

		std::vector< std::string > m_DefaultValue;
		T m_MinValue;
		T m_MaxValue;
	};

	#include "OptionTypeNumeric.inl"

}

#endif